-- card: 37750 from stack: in.5 -- bmap block id: 43331 -- flags: 0000 -- background id: 3858 -- name: MonitorConfig ----- HyperTalk script ----- on CloseCard put empty into cd fld "monitor list" set the scroll of cd fld "monitor list" to 0 pass CloseCard end CloseCard on HideObjects hide cd fld "monitor list" hide cd btn "all monitors" hide cd btn "cardwindow" end HideObjects on ShowObjects show cd fld "monitor list" show cd btn "all monitors" show cd btn "cardwindow" end ShowObjects -- part 1 (field) -- low flags: 00 -- high flags: 0007 -- rect: left=19 top=117 right=288 bottom=236 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: Monitor list -- part 2 (button) -- low flags: 00 -- high flags: A002 -- rect: left=27 top=292 right=326 bottom=120 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 8192 -- line height: 16 -- part name: All monitors ----- HyperTalk script ----- on mouseUp global errGlobal put empty into cd fld "monitor list" repeat with monitorNdx = 1 to MonitorCount() put MonitorConfig(monitorNdx, "noDialog:errGlobal") into theConfig if errGlobal ≠ empty then answer "Error:" && errGlobal put empty into errGlobal else put theConfig & return after cd fld "monitor list" end if end repeat end mouseUp -- part 3 (button) -- low flags: 00 -- high flags: A002 -- rect: left=132 top=292 right=326 bottom=225 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 8192 -- line height: 16 -- part name: CardWindow ----- HyperTalk script ----- on mouseUp global errGlobal put MonitorConfig("CardWindow", "noDialog:errGlobal") into theConfig if errGlobal ≠ empty then answer "Error: “" & errGlobal & "”" put empty into errGlobal else put theConfig into cd fld "monitor list" end if end mouseUp -- part contents for background part 38 ----- text ----- 31/50 -- part contents for background part 20 ----- text ----- An XFCN which returns the current configuration of the Mac's monitor(s). The information returned for each monitor is: Line 1 - absolute global coordinates of the monitor. The point 0,0 in this world is the upper left corner of the menu bar. Line 2 - horizontal and vertical size of the monitor (in pixels). Line 3 - NuBus slot number of the monitor's video card. Numbers start at 1 (slot nearest the power supply). Line 4 - current bit depth and color setting. Line 5 - "Active" if the monitor it has been activated from the Monitors cdev , or "Inactive" if it is inactive. Line 6 - "Has menu bar" if the monitor contains the menu bar, empty if not. Calling syntax : monitorConfig(monitorNum or “CardWindow”,<“noDialog”:errorGlobal> ) MONITORNUM: which monitor to check (monitor #1 is the boot monitor ie. it shows the "smiley mac" on bootup or when holding the option key down while in the 'Monitors' CDEV). CARDWINDOW: report on the monitor containing the HyperCard window. NOTE - the XFCN uses the middle of the card window as it's location. If that point is offscreen it checks the following points (in order) until it finds one which is onscreen: middle of the window's title bar, upper right corner of the window's title bar, and upper left of the window's title bar.